There are many interactive data-editing software applications developed for editing a wide variety of data objects, such as text documents, business charts, engineering drawings, digital pictures, computer graphics, etc. With commonly used data-editing applications, a user modifies a data object by interactively applying consecutive editing operations to the data object. For example, the user of a word processing program edits a text document by typing and deleting words, cutting, pasting, reformatting, etc., and the user of a digital painting program may modify a picture by applying multiple strokes of various digital paintbrushes.
Regardless of the types of data object and interactive editing operations involved, the user, from time to time, decides the effects of one or more editing steps are not desirable and opts to remove the changes made by those editing steps. To that end, most interactive data-editing applications support an “undo” function that restores the data object to a state prior to the undesired edits.
A widely used approach to implement the undo function is the “serialized” approach. Under this serialized approach, to undo the last editing step, the inverse of the last editing command is applied to the data object to return the data object to its previous state. The approach is serial in that editing operations only can be undone in reverse of the order in which they were originally performed. For example, this serialized approach is commonly used in word processing programs to undo editing operations.
To enable the undoing of editing operations, the editing commands (e.g., insertion, deletion, cutting, pasting, formatting, etc.) and the corresponding changes (such as the inserted or deleted portions) may be saved in a buffer. Each time the user selects the undo function, the inverse of the last editing operation is applied to the document to recreate its prior state. By way of example, a deletion performed on a document can be undone by reinserting the deleted portion into the document. By selecting the undo function multiple times, the user can undo multiple consecutive editing steps applied to a document.
In another serialized approach, when a user inputs a command to edit a data object, the application takes a first snapshot (e.g., a copy) of the content of the data object, performs the editing operation, and takes a second snapshot of the content of the data object. A predetermined number of snapshots can be taken showing the data object in different states. In general, the undo operation is implemented by reloading a previous snapshot of the data object.
Both of these approaches can be disadvantageous in particular situations. For example, a user only can undo editing operations in a serial fashion and cannot select specific operations to undo without undoing intervening operations as well. In addition, in shared environments in which multiple users edit the same data object, a first user could cancel the effects of a second user's work unintentionally. If the shared data object is associated only with a single record of prior states, then a first user attempting to undo the first user's editing operation could inadvertently undo an editing operation performed by a second user after the first user's editing operation and before issuance of the undo request.
It is with respect to these and other considerations that the present invention has been made.